from django.db import models


class User(models.Model):
    id = models.AutoField("id", primary_key=True)
    username = models.CharField("用户名", max_length=80, default="")
    password = models.CharField("密码", max_length=100, default="")
    sex = models.CharField("性别", max_length=10, default="")
    address = models.CharField("地址", max_length=500, default="")
    avatar = models.FileField("头像", upload_to="avatar", default="/static/img/default.png")
    textarea = models.CharField("个人简介", max_length=500, default="这个人很懒，什么有没留下。")
    createTime = models.DateField("创建时间", auto_now_add=True)


class TravelInfo(models.Model):
    city = models.CharField("城市", max_length=80, default="")
    title = models.CharField("景点名称", max_length=255, default="")
    cover = models.URLField("封面", max_length=500, default="")
    sightId = models.CharField("详情id", max_length=100, default="")
    price = models.FloatField("价格", default=0.0)
    interestNum = models.IntegerField("感兴趣人数", default=0)
    score = models.FloatField("评分", default=0.0)
    detailUrl = models.URLField("详情地址", max_length=500, default="")
    address = models.CharField("景点地址", max_length=500, default="")
    introduce = models.TextField("景点介绍", default="")
    img_list = models.TextField("景点图片", default="")
    comment_total = models.IntegerField("总评论数", default=0)
    commentList = models.TextField("评论列表", default="")
    level = models.CharField("景点等级", max_length=20, default="")
    province = models.CharField("省份", max_length=50, default="")